\(\int \frac {4-3 \tan (a+b x)}{\sqrt {4+3 \tan (a+b x)}} \, dx\) [377]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F(-1)]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 25, antiderivative size = 85 \[ \int \frac {4-3 \tan (a+b x)}{\sqrt {4+3 \tan (a+b x)}} \, dx=-\frac {9 \arctan \left (\frac {1-3 \tan (a+b x)}{\sqrt {2} \sqrt {4+3 \tan (a+b x)}}\right )}{5 \sqrt {2} b}+\frac {13 \text {arctanh}\left (\frac {3+\tan (a+b x)}{\sqrt {2} \sqrt {4+3 \tan (a+b x)}}\right )}{5 \sqrt {2} b} \]

[Out]

-9/10*arctan(1/2*(1-3*tan(b*x+a))*2^(1/2)/(4+3*tan(b*x+a))^(1/2))/b*2^(1/2)+13/10*arctanh(1/2*(3+tan(b*x+a))*2
^(1/2)/(4+3*tan(b*x+a))^(1/2))/b*2^(1/2)

Rubi [A] (verified)

Time = 0.14 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {3617, 3616, 209, 213} \[ \int \frac {4-3 \tan (a+b x)}{\sqrt {4+3 \tan (a+b x)}} \, dx=\frac {13 \text {arctanh}\left (\frac {\tan (a+b x)+3}{\sqrt {2} \sqrt {3 \tan (a+b x)+4}}\right )}{5 \sqrt {2} b}-\frac {9 \arctan \left (\frac {1-3 \tan (a+b x)}{\sqrt {2} \sqrt {3 \tan (a+b x)+4}}\right )}{5 \sqrt {2} b} \]

[In]

Int[(4 - 3*Tan[a + b*x])/Sqrt[4 + 3*Tan[a + b*x]],x]

[Out]

(-9*ArcTan[(1 - 3*Tan[a + b*x])/(Sqrt[2]*Sqrt[4 + 3*Tan[a + b*x]])])/(5*Sqrt[2]*b) + (13*ArcTanh[(3 + Tan[a +
b*x])/(Sqrt[2]*Sqrt[4 + 3*Tan[a + b*x]])])/(5*Sqrt[2]*b)

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 3616

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/Sqrt[(a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[-2*(
d^2/f), Subst[Int[1/(2*b*c*d - 4*a*d^2 + x^2), x], x, (b*c - 2*a*d - b*d*Tan[e + f*x])/Sqrt[a + b*Tan[e + f*x]
]], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && EqQ[2
*a*c*d - b*(c^2 - d^2), 0]

Rule 3617

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/Sqrt[(a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]], x_Symbol] :> With[{q =
 Rt[a^2 + b^2, 2]}, Dist[1/(2*q), Int[(a*c + b*d + c*q + (b*c - a*d + d*q)*Tan[e + f*x])/Sqrt[a + b*Tan[e + f*
x]], x], x] - Dist[1/(2*q), Int[(a*c + b*d - c*q + (b*c - a*d - d*q)*Tan[e + f*x])/Sqrt[a + b*Tan[e + f*x]], x
], x]] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && NeQ[2
*a*c*d - b*(c^2 - d^2), 0] && (PerfectSquareQ[a^2 + b^2] || RationalQ[a, b, c, d])

Rubi steps \begin{align*} \text {integral}& = \frac {1}{10} \int \frac {27+9 \tan (a+b x)}{\sqrt {4+3 \tan (a+b x)}} \, dx-\frac {1}{10} \int \frac {-13+39 \tan (a+b x)}{\sqrt {4+3 \tan (a+b x)}} \, dx \\ & = -\frac {81 \text {Subst}\left (\int \frac {1}{162+x^2} \, dx,x,\frac {9-27 \tan (a+b x)}{\sqrt {4+3 \tan (a+b x)}}\right )}{5 b}+\frac {1521 \text {Subst}\left (\int \frac {1}{-27378+x^2} \, dx,x,\frac {-351-117 \tan (a+b x)}{\sqrt {4+3 \tan (a+b x)}}\right )}{5 b} \\ & = -\frac {9 \arctan \left (\frac {1-3 \tan (a+b x)}{\sqrt {2} \sqrt {4+3 \tan (a+b x)}}\right )}{5 \sqrt {2} b}+\frac {13 \text {arctanh}\left (\frac {3+\tan (a+b x)}{\sqrt {2} \sqrt {4+3 \tan (a+b x)}}\right )}{5 \sqrt {2} b} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.11 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.88 \[ \int \frac {4-3 \tan (a+b x)}{\sqrt {4+3 \tan (a+b x)}} \, dx=\frac {(3-4 i) \text {arctanh}\left (\frac {\sqrt {4+3 \tan (a+b x)}}{\sqrt {4-3 i}}\right )}{\sqrt {4-3 i} b}+\frac {(3+4 i) \text {arctanh}\left (\frac {\sqrt {4+3 \tan (a+b x)}}{\sqrt {4+3 i}}\right )}{\sqrt {4+3 i} b} \]

[In]

Integrate[(4 - 3*Tan[a + b*x])/Sqrt[4 + 3*Tan[a + b*x]],x]

[Out]

((3 - 4*I)*ArcTanh[Sqrt[4 + 3*Tan[a + b*x]]/Sqrt[4 - 3*I]])/(Sqrt[4 - 3*I]*b) + ((3 + 4*I)*ArcTanh[Sqrt[4 + 3*
Tan[a + b*x]]/Sqrt[4 + 3*I]])/(Sqrt[4 + 3*I]*b)

Maple [A] (verified)

Time = 0.23 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.58

method result size
derivativedivides \(\frac {\frac {13 \sqrt {2}\, \ln \left (9+3 \tan \left (b x +a \right )+3 \sqrt {4+3 \tan \left (b x +a \right )}\, \sqrt {2}\right )}{20}+\frac {9 \sqrt {2}\, \arctan \left (\frac {\left (2 \sqrt {4+3 \tan \left (b x +a \right )}+3 \sqrt {2}\right ) \sqrt {2}}{2}\right )}{10}-\frac {13 \sqrt {2}\, \ln \left (9+3 \tan \left (b x +a \right )-3 \sqrt {4+3 \tan \left (b x +a \right )}\, \sqrt {2}\right )}{20}+\frac {9 \sqrt {2}\, \arctan \left (\frac {\left (2 \sqrt {4+3 \tan \left (b x +a \right )}-3 \sqrt {2}\right ) \sqrt {2}}{2}\right )}{10}}{b}\) \(134\)
default \(\frac {\frac {13 \sqrt {2}\, \ln \left (9+3 \tan \left (b x +a \right )+3 \sqrt {4+3 \tan \left (b x +a \right )}\, \sqrt {2}\right )}{20}+\frac {9 \sqrt {2}\, \arctan \left (\frac {\left (2 \sqrt {4+3 \tan \left (b x +a \right )}+3 \sqrt {2}\right ) \sqrt {2}}{2}\right )}{10}-\frac {13 \sqrt {2}\, \ln \left (9+3 \tan \left (b x +a \right )-3 \sqrt {4+3 \tan \left (b x +a \right )}\, \sqrt {2}\right )}{20}+\frac {9 \sqrt {2}\, \arctan \left (\frac {\left (2 \sqrt {4+3 \tan \left (b x +a \right )}-3 \sqrt {2}\right ) \sqrt {2}}{2}\right )}{10}}{b}\) \(134\)
parts \(-\frac {\sqrt {2}\, \ln \left (9+3 \tan \left (b x +a \right )-3 \sqrt {4+3 \tan \left (b x +a \right )}\, \sqrt {2}\right )}{5 b}+\frac {6 \sqrt {2}\, \arctan \left (\frac {\left (2 \sqrt {4+3 \tan \left (b x +a \right )}-3 \sqrt {2}\right ) \sqrt {2}}{2}\right )}{5 b}+\frac {\sqrt {2}\, \ln \left (9+3 \tan \left (b x +a \right )+3 \sqrt {4+3 \tan \left (b x +a \right )}\, \sqrt {2}\right )}{5 b}+\frac {6 \sqrt {2}\, \arctan \left (\frac {\left (2 \sqrt {4+3 \tan \left (b x +a \right )}+3 \sqrt {2}\right ) \sqrt {2}}{2}\right )}{5 b}-\frac {3 \left (\frac {3 \sqrt {2}\, \ln \left (9+3 \tan \left (b x +a \right )-3 \sqrt {4+3 \tan \left (b x +a \right )}\, \sqrt {2}\right )}{20}+\frac {\sqrt {2}\, \arctan \left (\frac {\left (2 \sqrt {4+3 \tan \left (b x +a \right )}-3 \sqrt {2}\right ) \sqrt {2}}{2}\right )}{10}-\frac {3 \sqrt {2}\, \ln \left (9+3 \tan \left (b x +a \right )+3 \sqrt {4+3 \tan \left (b x +a \right )}\, \sqrt {2}\right )}{20}+\frac {\sqrt {2}\, \arctan \left (\frac {\left (2 \sqrt {4+3 \tan \left (b x +a \right )}+3 \sqrt {2}\right ) \sqrt {2}}{2}\right )}{10}\right )}{b}\) \(276\)

[In]

int((4-3*tan(b*x+a))/(4+3*tan(b*x+a))^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/b*(13/20*2^(1/2)*ln(9+3*tan(b*x+a)+3*(4+3*tan(b*x+a))^(1/2)*2^(1/2))+9/10*2^(1/2)*arctan(1/2*(2*(4+3*tan(b*x
+a))^(1/2)+3*2^(1/2))*2^(1/2))-13/20*2^(1/2)*ln(9+3*tan(b*x+a)-3*(4+3*tan(b*x+a))^(1/2)*2^(1/2))+9/10*2^(1/2)*
arctan(1/2*(2*(4+3*tan(b*x+a))^(1/2)-3*2^(1/2))*2^(1/2)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 309 vs. \(2 (71) = 142\).

Time = 0.25 (sec) , antiderivative size = 309, normalized size of antiderivative = 3.64 \[ \int \frac {4-3 \tan (a+b x)}{\sqrt {4+3 \tan (a+b x)}} \, dx=-\frac {1}{10} \, \sqrt {\frac {117 \, b^{2} \sqrt {-\frac {1}{b^{4}}} + 44}{b^{2}}} \log \left (\frac {1}{5} \, {\left (7 \, b^{3} \sqrt {-\frac {1}{b^{4}}} - 24 \, b\right )} \sqrt {\frac {117 \, b^{2} \sqrt {-\frac {1}{b^{4}}} + 44}{b^{2}}} + 25 \, \sqrt {3 \, \tan \left (b x + a\right ) + 4}\right ) + \frac {1}{10} \, \sqrt {\frac {117 \, b^{2} \sqrt {-\frac {1}{b^{4}}} + 44}{b^{2}}} \log \left (-\frac {1}{5} \, {\left (7 \, b^{3} \sqrt {-\frac {1}{b^{4}}} - 24 \, b\right )} \sqrt {\frac {117 \, b^{2} \sqrt {-\frac {1}{b^{4}}} + 44}{b^{2}}} + 25 \, \sqrt {3 \, \tan \left (b x + a\right ) + 4}\right ) + \frac {1}{10} \, \sqrt {-\frac {117 \, b^{2} \sqrt {-\frac {1}{b^{4}}} - 44}{b^{2}}} \log \left (\frac {1}{5} \, {\left (7 \, b^{3} \sqrt {-\frac {1}{b^{4}}} + 24 \, b\right )} \sqrt {-\frac {117 \, b^{2} \sqrt {-\frac {1}{b^{4}}} - 44}{b^{2}}} + 25 \, \sqrt {3 \, \tan \left (b x + a\right ) + 4}\right ) - \frac {1}{10} \, \sqrt {-\frac {117 \, b^{2} \sqrt {-\frac {1}{b^{4}}} - 44}{b^{2}}} \log \left (-\frac {1}{5} \, {\left (7 \, b^{3} \sqrt {-\frac {1}{b^{4}}} + 24 \, b\right )} \sqrt {-\frac {117 \, b^{2} \sqrt {-\frac {1}{b^{4}}} - 44}{b^{2}}} + 25 \, \sqrt {3 \, \tan \left (b x + a\right ) + 4}\right ) \]

[In]

integrate((4-3*tan(b*x+a))/(4+3*tan(b*x+a))^(1/2),x, algorithm="fricas")

[Out]

-1/10*sqrt((117*b^2*sqrt(-1/b^4) + 44)/b^2)*log(1/5*(7*b^3*sqrt(-1/b^4) - 24*b)*sqrt((117*b^2*sqrt(-1/b^4) + 4
4)/b^2) + 25*sqrt(3*tan(b*x + a) + 4)) + 1/10*sqrt((117*b^2*sqrt(-1/b^4) + 44)/b^2)*log(-1/5*(7*b^3*sqrt(-1/b^
4) - 24*b)*sqrt((117*b^2*sqrt(-1/b^4) + 44)/b^2) + 25*sqrt(3*tan(b*x + a) + 4)) + 1/10*sqrt(-(117*b^2*sqrt(-1/
b^4) - 44)/b^2)*log(1/5*(7*b^3*sqrt(-1/b^4) + 24*b)*sqrt(-(117*b^2*sqrt(-1/b^4) - 44)/b^2) + 25*sqrt(3*tan(b*x
 + a) + 4)) - 1/10*sqrt(-(117*b^2*sqrt(-1/b^4) - 44)/b^2)*log(-1/5*(7*b^3*sqrt(-1/b^4) + 24*b)*sqrt(-(117*b^2*
sqrt(-1/b^4) - 44)/b^2) + 25*sqrt(3*tan(b*x + a) + 4))

Sympy [F]

\[ \int \frac {4-3 \tan (a+b x)}{\sqrt {4+3 \tan (a+b x)}} \, dx=- \int \frac {3 \tan {\left (a + b x \right )}}{\sqrt {3 \tan {\left (a + b x \right )} + 4}}\, dx - \int \left (- \frac {4}{\sqrt {3 \tan {\left (a + b x \right )} + 4}}\right )\, dx \]

[In]

integrate((4-3*tan(b*x+a))/(4+3*tan(b*x+a))**(1/2),x)

[Out]

-Integral(3*tan(a + b*x)/sqrt(3*tan(a + b*x) + 4), x) - Integral(-4/sqrt(3*tan(a + b*x) + 4), x)

Maxima [F]

\[ \int \frac {4-3 \tan (a+b x)}{\sqrt {4+3 \tan (a+b x)}} \, dx=\int { -\frac {3 \, \tan \left (b x + a\right ) - 4}{\sqrt {3 \, \tan \left (b x + a\right ) + 4}} \,d x } \]

[In]

integrate((4-3*tan(b*x+a))/(4+3*tan(b*x+a))^(1/2),x, algorithm="maxima")

[Out]

-integrate((3*tan(b*x + a) - 4)/sqrt(3*tan(b*x + a) + 4), x)

Giac [F(-1)]

Timed out. \[ \int \frac {4-3 \tan (a+b x)}{\sqrt {4+3 \tan (a+b x)}} \, dx=\text {Timed out} \]

[In]

integrate((4-3*tan(b*x+a))/(4+3*tan(b*x+a))^(1/2),x, algorithm="giac")

[Out]

Timed out

Mupad [B] (verification not implemented)

Time = 8.94 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.73 \[ \int \frac {4-3 \tan (a+b x)}{\sqrt {4+3 \tan (a+b x)}} \, dx=\mathrm {atan}\left (\frac {b\,\sqrt {\frac {-\frac {16}{25}-\frac {12}{25}{}\mathrm {i}}{b^2}}\,\sqrt {3\,\mathrm {tan}\left (a+b\,x\right )+4}}{2}\right )\,\sqrt {\frac {-\frac {16}{25}-\frac {12}{25}{}\mathrm {i}}{b^2}}\,2{}\mathrm {i}-\mathrm {atan}\left (\frac {b\,\sqrt {\frac {-\frac {16}{25}+\frac {12}{25}{}\mathrm {i}}{b^2}}\,\sqrt {3\,\mathrm {tan}\left (a+b\,x\right )+4}}{2}\right )\,\sqrt {\frac {-\frac {16}{25}+\frac {12}{25}{}\mathrm {i}}{b^2}}\,2{}\mathrm {i}+2\,\mathrm {atanh}\left (\frac {2\,b\,\sqrt {\frac {\frac {9}{25}-\frac {27}{100}{}\mathrm {i}}{b^2}}\,\sqrt {3\,\mathrm {tan}\left (a+b\,x\right )+4}}{3}\right )\,\sqrt {\frac {\frac {9}{25}-\frac {27}{100}{}\mathrm {i}}{b^2}}+2\,\mathrm {atanh}\left (\frac {2\,b\,\sqrt {\frac {\frac {9}{25}+\frac {27}{100}{}\mathrm {i}}{b^2}}\,\sqrt {3\,\mathrm {tan}\left (a+b\,x\right )+4}}{3}\right )\,\sqrt {\frac {\frac {9}{25}+\frac {27}{100}{}\mathrm {i}}{b^2}} \]

[In]

int(-(3*tan(a + b*x) - 4)/(3*tan(a + b*x) + 4)^(1/2),x)

[Out]

atan((b*((- 16/25 - 12i/25)/b^2)^(1/2)*(3*tan(a + b*x) + 4)^(1/2))/2)*((- 16/25 - 12i/25)/b^2)^(1/2)*2i - atan
((b*((- 16/25 + 12i/25)/b^2)^(1/2)*(3*tan(a + b*x) + 4)^(1/2))/2)*((- 16/25 + 12i/25)/b^2)^(1/2)*2i + 2*atanh(
(2*b*((9/25 - 27i/100)/b^2)^(1/2)*(3*tan(a + b*x) + 4)^(1/2))/3)*((9/25 - 27i/100)/b^2)^(1/2) + 2*atanh((2*b*(
(9/25 + 27i/100)/b^2)^(1/2)*(3*tan(a + b*x) + 4)^(1/2))/3)*((9/25 + 27i/100)/b^2)^(1/2)